"""
    create by IAmFiveHigh on 2023/8/17
"""
from array_generator import ArrayGenerator
from sort_helper import SortHelper

sort_names = ["选择排序",
              "插入排序",
              "归并排序",
              "自底向上归并排序",
              "快速排序",
              "三路快速排序",
              "冒泡排序",
              "希尔排序"]


def construct(sequence, title):
    print("-" * 10, title, "-" * 10)
    sequences = []
    for i in range(0, len(sort_names)):
        sequences.append(sequence[:])
    for i in range(0, len(sort_names)):
        SortHelper.sort_test(sort_names[i], sequences[i])


if __name__ == '__main__':
    # 有序数组
    sort = ArrayGenerator.generate_sorted_array(10000)
    construct(sort, "有序数组")

    unsort = ArrayGenerator.generate_random_array(1000)
    construct(unsort, "无序数组")

    unsort2 = ArrayGenerator.generate_random_array(10000)
    construct(unsort2, "无序数组")